#ifndef PYNOTOWINDOW_H
#define PYNOTOWINDOW_H

#include <QDebug>
#include <QMainWindow>
#include <QPluginLoader>
#include <QApplication>
#include <QDir>
#include <QPointer>
#include "Include/IPluginBase.h"
#include "Include/Plugins.h"

namespace Ui {
    class PynotoWindow;
}

namespace Plugins {
    class IProjectManager;
    class IEditorsManager;
}

class PynotoWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit PynotoWindow(QWidget *parent = 0);
    virtual ~PynotoWindow();

protected:
    void changeEvent(QEvent *e);
    void loadPlugins();
    void setAction(QAction *action, const char *slot, const QString & iconName = "");
    void setAction(QWidget * reciver, QAction *action, const char *slot, const QString & iconName = "");
private:
    void setupProjectManager();
    void setupEditors();
private slots:
    void onProjectAvailable(bool avail);
    void openProject();
    void showPreferences();
    void projectRun();
private:
    Ui::PynotoWindow *ui;
    PluginWrapper<Plugins::IProjectManager> _projectManager;
    PluginWrapper<Plugins::IEditorsManager> _editors;
};

#endif // PYNOTOWINDOW_H
